A portion of the disclosure of this patent document contains material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
The present invention relates generally to the field of object based software systems, and more particularly to techniques for managing relationships between objects of the software systems and maintaining data and referential integrity of the software systems when an object is changed, for example, modified, copied, or deleted.
With the increase in the number of heterogeneous application programs used by consumers, it become increasingly important that these applications be able to communicate with each other in a consistent manner without having to know the. implementation details of the applications involved. Traditionally, this was accomplished by using applications developed by a common vendor or by a group of vendors who had agreed upon a common interface between the various applications. While this approach achieved a limited degree of success in integrating heterogeneous applications, the approach soon became unfeasible as the number of vendors and the number of applications rapidly increased.
More recently vendors are attempting to solve the application integration problem by developing applications using object-oriented frameworks and repository technology. Repositories enable sharing and reuse of information by providing a common hub for storing metadata which describes the structure and meaning of software components. Metadata enables heterogeneous applications to manipulate software components without knowing the implementations of the components. To promote sharing and reuse of metadata information among heterogeneous applications, information models are defined to standardize the structure and semantics of the metadata. A repository, using a standardized information model, provides a global and consistent mechanism for accessing metadata for application development.
An example of a repository is the Microsoft Repository developed by Microsoft Corporation of Redmond, Wash. The Microsoft Repository uses the Open Information Model (OIM) for describing metadata specifications and provides an environment for sharing, reuse, and integration of metadata for application development. Information stored in the Microsoft Repository is exposed using Microsoft""s Common Object Model (COM) which forms the basis for the Object Linking and Embedding (OLE) technology which allows objects to share data and capabilities. COM defines a binary standard for object implementation that is independent of the implementation programming language. COM objects are in-memory representations of the information stored in the repository. A repository may include a object-oriented or relational or mixed database.
The repository information model defines the classes of the objects, types of relationships that can exist between the objects, and various properties that are attached to the object classes and the relationship types. A xe2x80x9cclassxe2x80x9d may contain properties, methods, and collections which are grouped into functionally related groups which are implemented as COM xe2x80x9cinterfaces.xe2x80x9d In COM, a class may have multiple interfaces which are publicly accessible to users of the object-oriented framework and enable communication between applications.
A repository object is defined in terms of the interfaces that it exposes. The set of interfaces that an object exposes describes the object""s state, the manner in which the object can be manipulated, and the associations the object can have with other objects. Relationships may also be defined between interfaces of different objects or of the same object. Further information and details about COM and OLE may be obtained from xe2x80x9cInside OLE 2xe2x80x9d by Kraig Brockschmidt, 1994, Microsoft Press, and xe2x80x9cInside COM, Microsoft""s Component Object Model,xe2x80x9d by Dale Rogerson, 1997, Microsoft press, both of which are hereby incorporated by reference for all purposes.
FIG. 1 depicts a convention representation of a COM interface 10, for an object 11 (another term for object 11 is component) and a user 12 of the object. Object 11 is said to have an xe2x80x9cinterface implementationxe2x80x9d, including interfaces 13 and 14, that are analogous to an object oriented programming xe2x80x9cclass.xe2x80x9d Interfaces 13 and 14 include member functions 15 and 16, respectively. User 12 can manipulate object 11 by calling functions 15, and 16 of interfaces 13 and/or interface 14, respectively. In response to the function calls, object 11 may return specific data about itself to user 12. Object 11, however maintains exclusive control of its own data 17. In some cases user 12 may only be aware of one of several interfaces available in object 12. The available interface may then be queried for additional interfaces. A pointer to the queried interface is returned if the queried interface is supported by the object. For example, the IUnknown interface 13 is a COM interface that is typically available to all users of COM objects. The IUnknown interface may then be queried to obtain pointers to other interfaces supported by the object, such as interface 14. After obtaining a pointer to interface 14, user 12 can call member functions 16 belonging to interface 14.
As previously stated, relationships may be established between interfaces of one or more objects or between interfaces of the same object. A relationship describes the way in which one object refers to another object, as exposed through their interfaces. The participants in a relationship are usually referred to as xe2x80x9centitiesxe2x80x9d participating in the relationship. Relationships are usually binary, for example relationships in Microsoft Repository, may be directed or bidirectional. A relationship typically includes an origin of the relationship, referred to as the xe2x80x9coriginxe2x80x9d entity, and a destination of the relationship, referred to as the xe2x80x9cdestinationxe2x80x9d entity. In Microsoft Repository, each relationship conforms to a particular relationship type and is associated with an object of the class RelationshipDef. This object contains the metadata associated with the relationship.
Several actions have to be preformed when entities involved in a relationship are changed, for example, modified, copied, or deleted. These operations are important for maintaining referential and data integrity of the object system. Accordingly, an important aspect of any object-oriented framework system is the manner in which referential and data integrity of the system is maintained when entities involved in a relationship are changed.
Several techniques have been developed for maintaining integrity of the object system when entities participating in relationships are changed. In conventional systems, the actions be performed upon a change operation are usually associated with each occurrence of the relationship. In addition, the code implementing the actions is typically spread through out the object implementation and thus is difficult to understand and maintain. The increased complexity of the implementation also makes it unsuitable for modification or customization.
Thus, there is a need for a relationship management system which allows generalized relationships to be defined between objects and which provides a simplified technique for maintaining referential and data integrity of the object system when objects involved in a relationship are changed.
One embodiment of the present invention provides a method of maintaining consistency between objects in a computer system. The method includes providing a first relationship between a first entity and a second entity. A semantic is also provided, including an action to be performed in response to a change in the first entity. A semantic object is associated with the second entity and making a change in the first entity invokes the action. In a second embodiment, the method may also include providing a second relationship between a third entity and the second entity. And after the action is invoked, performing the action on the third entity. The action may be selected from a group consisting of copy, delete, and modify.
In another embodiment a computer system for maintaining consistency between objects is provided. The computer system includes a processor; and a memory coupled to the processor. The memory stores relationship pattern information and modules for execution by the processor. The pattern information includes information defining a first relationship between a first entity and a second entity, information defining a second relationship between a third entity and the second entity, and information defining a semantic object with actions to be performed for changing the third entity in response to changes in the first entity. The modules include a module for associating the semantic object with the second entity and a module for invoking the actions when the first entity is changed.
In yet another embodiment a method of assembling information in order to maintain integrity of objects in a database is provided. The method includes establishing a relationship pattern, having a binary relation between a first entity and a second entity. A semantic object having an action to be performed in response to a change in the first entity is provided and is associated with the second entity. Metadata having information from the relationship pattern and arguments of the semantic object are then determined. The metadata and the semantic object are stored. In one embodiment the metadata is stored in a COM or CORBA repository and the semantic object is stored in a DLL file.
In another embodiment a method for updating information in a database, having a first relation between a first entity and a second entity and a second relation between a second entity and a third entity is provided. A first object of the first entity is next changed. The first relation associated with the first object is identified and using the first relation and repository metadata, the second entity is identified. The second entity is also identified as an active entity. A semantic object associated with the active entity is next found, where the semantic object has an action to be performed in response to a change in the first entity. Using arguments of the semantic object, the third entity is identified. Lastly, the action is evaluated to change the third entity.
In another embodiment a method for providing consistency among persistent objects in a computer system is disclosed. The technique includes using the metadata in a repository to construct a graph having entities and relations; A semantic object is associated with each active entity. A passive entity having a persistent object is then changed in the graph; and the graph is traversed to update the entities using the semantic objects.